<template>
  <div class="page">
	<div class="layui-fluid">
			<div class="layui-row layui-col-space15">
				<div class="layui-col-md12">
					<div class="layui-card">
						<div class="layui-card-body">
							<div class="layui-form">
							<div class="layui-form-item">
									 <label class="layui-form-label">审核状态</label>
									     <div class="layui-input-block" style="width: 300px;">
										    <select lay-filter="atatus">
														<option value='NOTYET'>待审核</option>
														<option value='PASS'>审核通过</option>
														<option value='FAIL'>审核不通过 </option>
													</select>
										    </div>
								  </div>
								  
								  <div class="layui-form-item">
										<div class="layui-inline">
										    <label class="layui-form-label">审核原因 </label>
										    <div class="layui-input-inline" >
										         <textarea style="width:300px;height:150px" name="desc" placeholder="请输入内容" class="layui-textarea" v-model="reson"></textarea>
										    </div>
									  </div>
									</div>
									
									<div class="layui-form-item">
							      <label class="layui-form-label">卡款凭证</label>
							      <div class="layui-input-inline">
							         <div class="layui-upload">
											  <button type="button" class="layui-btn" id="layuiadmin-upload-useradmin">上传图片</button>
											  <div class="layui-upload-list">
											    <img class="layui-upload-img" id="logo" :src="evidence?evidence:'http://kedoujfpc.tongdui365.com/static/common/image/zwyl.jpg'" width="100" height="100" style="border:1px solid #eee;">
											    <p id="demoText"></p>
											  </div>
											</div>
							      </div>
							    </div>
									
									
									<div class="layui-form-item">
										<div class="layui-input-block">
											<button class="layui-btn layui-btn-normal" lay-submit lay-filter="setmyinfo" @click="confirmOk">确认</button>
										</div>
									</div>
									
								</div>
							
						</div>
					</div>
				</div>
			</div>
		</div>
  </div>
</template>
<script>
export default {	
  name: 'operatoradd',  
  data () {
    return { 
    	id:'',
    	evidence:'',
    	reson:'',
    	authStatus:'NOTYET',
    	byfrom:'',
    	
  	}
  },
  mounted(){ 
  	var _this = this;   	
  	layui.use('form', function(){
		  var form = layui.form;
		  form.render();
		  form.on('select(atatus)', function(data){
				 	_this.authStatus=data.value;
			});
		})
  	layui.use('upload', function(){
		  var upload = layui.upload;
		  var uploadInst = upload.render({
		    elem: '#layuiadmin-upload-useradmin',//绑定元素
		    data:{
		    	type:3
		    }
		    ,url:imguploadurl //上传接口
		    ,done: function(res){
		    	layer.msg('上传成功');
		    	 _this.evidence=res.msg;
		    }
		    ,error: function(){
		      layer.msg('上传失败');
		    }
		  });
		});
	  window.getdates = this.getdates;
	 
  },
  methods: {  	
		getdates:function(dates){
  		this.id=dates.id
  		this.byfrom=dates.byfrom
  	},
		confirmOk:function(){
			var url='/pay/aapi/v1.9/settlement/getAuthApply'
			if(this.byfrom=='sqtxlist'){
				url='/pay/aapi/v1.9/withdrawal-record/authWithdrawal'
			}
			var dates={
			  "authStatus": this.authStatus,
			  "evidence": this.evidence,
			  "id":this.id,
			  "reson":this.reson
			}
			ajaxRequest(url, 'PUT', 'json',dates, function(ret, err){
			  layer.msg("操作成功");
			  setTimeout(function(){
			  	var index = parent.layer.getFrameIndex(window.name);
			    parent.layer.close(index);
		      parent.location.reload();
	      },1000)
			})
		}
  },
  updated:function(){
		
  },

}
</script>
<style scoped>
	.red{color:#ff0000;}
	.layuitj{float:left;line-height:38px;color:#FF0000;}
	.layuitj1{margin-left:20px;}
</style>
